<template>
    <svg class="icon" :class="customClass" aria-hidden="true">
        <use :xlink:href="getIconSymbol"></use>
    </svg>
</template>
<script>

export default {
    name: "myIcon",
    props: {
        iconSymbol: { // 用来定义图标
            type: String,
            require: true
        },
        customClass: { // 用来定义需要的类名
            type: String,
        }
    },
    computed: {
        getIconSymbol() {
            return "#icon-" + this.iconSymbol;
        }
    }
}
</script>
<style lang='scss' scoped>
.icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
}
</style>